/*  1:   */ package org.jetbrains.jps.model.serialization.java.compiler;
/*  2:   */ 
/*  3:   */

import com.intellij.util.xmlb.XmlSerializer;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.model.JpsProject;
import org.jetbrains.jps.model.java.JpsJavaExtensionService;
import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerConfiguration;
import org.jetbrains.jps.model.java.compiler.JpsJavaCompilerOptions;
import org.jetbrains.jps.model.serialization.JpsProjectExtensionSerializer;

/*  4:   */
/*  5:   */
/*  6:   */
/*  7:   */
/*  8:   */
/*  9:   */
/* 10:   */
/* 11:   */ 
/* 12:   */ public class JpsJavaCompilerOptionsSerializer
/* 13:   */   extends JpsProjectExtensionSerializer
/* 14:   */ {
/* 15:   */   private final String c;
/* 16:   */   
/* 17:   */   public JpsJavaCompilerOptionsSerializer(String paramString1, String paramString2)
/* 18:   */   {
/* 19:34 */     super("compiler.xml", paramString1);
/* 20:35 */     this.c = paramString2;
/* 21:   */   }
/* 22:   */   
/* 23:   */   public void loadExtension(@NotNull JpsProject paramJpsProject, @NotNull Element paramElement)
/* 24:   */   {
/* 25:40 */     if (paramJpsProject == null) {
/* 26:40 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/compiler/JpsJavaCompilerOptionsSerializer", "loadExtension" }));
/* 27:   */     }
/* 28:40 */     if (paramElement == null) {
/* 29:40 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/java/compiler/JpsJavaCompilerOptionsSerializer", "loadExtension" }));
/* 30:   */     }
/* 31:40 */     JpsJavaCompilerConfiguration localJpsJavaCompilerConfiguration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(paramJpsProject);
/* 32:41 */     JpsJavaCompilerOptions localJpsJavaCompilerOptions = (JpsJavaCompilerOptions)XmlSerializer.deserialize(paramElement, JpsJavaCompilerOptions.class);
/* 33:42 */     if (localJpsJavaCompilerOptions == null) {
/* 34:43 */       localJpsJavaCompilerOptions = new JpsJavaCompilerOptions();
/* 35:   */     }
/* 36:45 */     localJpsJavaCompilerConfiguration.setCompilerOptions(this.c, localJpsJavaCompilerOptions);
/* 37:   */   }
/* 38:   */   
/* 39:   */   public void loadExtensionWithDefaultSettings(@NotNull JpsProject paramJpsProject)
/* 40:   */   {
/* 41:50 */     if (paramJpsProject == null) {
/* 42:50 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/compiler/JpsJavaCompilerOptionsSerializer", "loadExtensionWithDefaultSettings" }));
/* 43:   */     }
/* 44:50 */     JpsJavaCompilerConfiguration localJpsJavaCompilerConfiguration = JpsJavaExtensionService.getInstance().getOrCreateCompilerConfiguration(paramJpsProject);
/* 45:51 */     localJpsJavaCompilerConfiguration.setCompilerOptions(this.c, new JpsJavaCompilerOptions());
/* 46:   */   }
/* 47:   */   
/* 48:   */   public void saveExtension(@NotNull JpsProject paramJpsProject, @NotNull Element paramElement)
/* 49:   */   {
/* 50:56 */     if (paramJpsProject == null) {
/* 51:56 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/java/compiler/JpsJavaCompilerOptionsSerializer", "saveExtension" }));
/* 52:   */     }
/* 53:56 */     if (paramElement == null) {
/* 54:56 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/java/compiler/JpsJavaCompilerOptionsSerializer", "saveExtension" }));
/* 55:   */     }
/* 56:   */   }
/* 57:   */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.serialization.java.compiler.JpsJavaCompilerOptionsSerializer

 * JD-Core Version:    0.7.0.1

 */